<!DOCTYPE html>
<html lang="zh-cn" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <link href="/style/style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="/js/public.js"></script>
    <script type="text/javascript" src="/js/jquery.js"></script>
       <script type="text/javascript" src="/js/jqpublic.js"></script>
    <script src="/js/vue.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
<body>

<section class="Topmenubg" id="headerMsg">
    <div class="Topnav">
        <div class="LeftNav">
            <span v-if="judge==0" class="Weltitle Block Font16 CorRed FontW Lineheight35"><a  href="/user/register">注册</a>/<a href="/user/login">登录</a></span>
            <span v-if="judge==1" class="Weltitle Block Font16 CorRed FontW Lineheight35">欢迎 {{user.name}}</span>
            <span v-if="judge==-1" class="Weltitle Block Font16 CorRed FontW Lineheight35"> </span>

        </div>
        <div class="RightNav">
            <a href="/user/ucenter">用户中心</a> <a href="/order/list" title="我的订单">我的订单</a> <a href="/cart_vue/cart">购物车（0）</a><a href="/user/collect" target="_blank" title="我的收藏">我的收藏</a> <a href="#">商家入驻</a>
        </div>
    </div>
</section>
<div class="Logo_search">
    <div class="Logo">
        <img src="/images/logo.jpg" title="DeathGhost" alt="模板">
        <i></i>
        <span>西安市 [ <a href="#">莲湖区</a> ]</span>
    </div>
    <div class="Search">
        <form method="get" id="main_a_serach" onsubmit="return check_search(this)" action="/shop/search">
            <div class="Search_nav" id="selectsearch">
                <a href="javascript:;" onClick="selectsearch(this,'restaurant_name')" class="choose">餐厅</a>
                <a href="javascript:;" onClick="selectsearch(this,'food_name')">食物名</a>
            </div>
            <div class="Search_area">
                <input type="search" id="fkeyword" name="keyword" placeholder="请输入您所需查找的餐厅名称或食物名称..." class="searchbox" />
                <input type="submit" class="searchbutton" value="搜 索" />
            </div>
        </form>
        <p class="hotkeywords"><a href="#" title="酸辣土豆丝">酸辣土豆丝</a><a href="#" title="这里是产品名称">螃蟹炒年糕</a><a href="#" title="这里是产品名称">牛奶炖蛋</a><a href="#" title="这里是产品名称">芝麻酱凉面</a><a href="#" title="这里是产品名称">滑蛋虾仁</a><a href="#" title="这里是产品名称">蒜汁茄子</a></p>
    </div>
</div>
<nav class="menu_bg">
    <ul class="menu">
        <li><a href="/user/index">首页</a></li>
        <li><a href="/shop/allShops">所有店铺</a></li>
        <li><a href="/dish/allDishes">所有菜品</a></li>
        <li><a href="/aboutUs">关于我们</a></li>
    </ul>
</nav>
</body>
<script>
    new Vue({
        el: "#headerMsg",
        data:{
            user:[],
            judge:-1,
        },
        methods: {

        },
        mounted: function () {

            axios.get("/user/getUser").then(r => {
                if (r.data.code == 200) {
                    this.judge=1;
                    this.user = r.data.data;
                    console.log(this.user);
                }else{
                    this.judge=0;
                }

            });

        }

    });

</script>
</html>